import {HTTP} from '../utils/http'


class LoginModel extends HTTP{

  sendCode(mobile){
    return this.request({
      url:'user/sendCode',
      data:{
        mobile:mobile,
      }
    })
  }

  login(mobile,verifyCode,nickName,picture){
    return this.request({
      url:'user/boundPhone',
      data:{
        phone:mobile,
        verifyCode:verifyCode,
        nickName:nickName,
        picture:picture
      }
    })
  }

  loginCode(code,userId){
    return this.request({
      url:'user/applet/login',
      data:{
        code:code,
        userId:userId,
      }
    })
  }
  UserInfo(sessionKey,encryptedData,iv){
    return this.request({
      url:'weChat/login/userinfo',
      data:{
        sessionKey:sessionKey,
        encryptedData:encryptedData,
        iv:iv
      }
    })
  }
  // getSessionKey(code){
  //   return this.request({
  //     url:'weChat/get/sessionKey',
  //     data:{
  //       code:code
  //     }
  //   })
  // }
  empower(picture,nickName,phone){
    return this.request({
      url:'user/empower/login',
      data:{
        picture:picture,
        nickName:nickName,
        phone:phone,
      }
    })
  }
  publishModelMessage(){
    return this.request({
      url:'wx/notice/publishModelMessage',
    })
  }
}
//微信消息通知

export {LoginModel}